<?php
namespace Home\Controller;
use Think\Controller;
header("Content-type:text/html;charset=utf-8");
class ExpeController extends Controller {
	public function _initialize(){
		$_SESSION['url1'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
		$uid = $_SESSION['user_id'];
		if(empty($uid)) {
			$hid = I("hid");
			$this->assign("hid",$hid);
			$this->display("Index/login");
		}
	}
	//预期
	public function yuqi(){
		$uid = $_SESSION['user_id'];
		if(!empty($uid)) {
			$hid = I("hid");
			$this->assign("hid",$hid);
			$this->display();
		}
	}
    //江苏k3追号计划
	public function jsk3(){
		$arr = $this->get_data("jsk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=1")->order("id desc")->limit(4)->select();
		$he = M("jihua_jsk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_jsk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_jsk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);

		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);

		$this->assign("r",$r);
		//中奖信息 end


//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end


		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function ahk3(){
		$arr = $this->get_data("ahk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=2")->order("id desc")->limit(4)->select();
		$he = M("jihua_ahk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_ahk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_ahk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);

		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);
		$this->assign("r",$r);
		//中奖信息 end
//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end


		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function gxk3(){
		$arr = $this->get_data("gxk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=3")->order("id desc")->limit(4)->select();
		$he = M("jihua_gxk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_gxk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_gxk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end


		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function hubk3(){
		$arr = $this->get_data("hubk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=4")->order("id desc")->limit(4)->select();
		$he = M("jihua_hubk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_hubk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_hubk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end
//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end

		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function bjk3(){
		$arr = $this->get_data("bjk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=5")->order("id desc")->limit(4)->select();
		$he = M("jihua_bjk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_bjk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_bjk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);

		//中奖信息 end
//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end

		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function hebk3(){
		$arr = $this->get_data("hebk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=9")->order("id desc")->limit(4)->select();
		$he = M("jihua_hebk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_hebk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_hebk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end


		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function gsk3(){
		$arr = $this->get_data("gsk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=10")->order("id desc")->limit(4)->select();
		$he = M("jihua_gsk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_gsk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_gsk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end

		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function shk3(){
		$arr = $this->get_data("shk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=11")->order("id desc")->limit(4)->select();
		$he = M("jihua_shk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_shk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_shk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end

		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function gzk3(){
		$arr = $this->get_data("gzk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=12")->order("id desc")->limit(4)->select();
		$he = M("jihua_gzk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_gzk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_gzk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	public function jlk3(){
		$arr = $this->get_data("jlk3");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_add")->where("uid = $uid and lotteryclass=13")->order("id desc")->limit(4)->select();
		$he = M("jihua_jlk3")->order("id desc")->limit(10)->select();
		$size = M("jihua_jlk3_size")->order("id desc")->limit(10)->select();
		$attr = M("jihua_jlk3_attr")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		foreach($size as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$size[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$size[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$size[$k]['sta'] = $zz1;
		}
		foreach($attr as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt2[] = substr($va,-3);
			}
			if(count($tt2)>1){
				$attr[$k]['iss'] = $tt2[0]."-".$tt2[1];
			}else{
				$attr[$k]['iss'] = $tt2[0];
			}
			$tt2 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$attr[$k]['sta'] = $zz1;
		}
//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end

		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->assign("size",$size);
		$this->assign("attr",$attr);
		$this->display();
	}
	//ssc追号计划
	public function zhui_k3(){
		$this->display();
	}
    //ssc追号计划
    public function zhui_ssc(){
        $this->display();
    }


	public function cqssc(){
		$arr = $this->get_data("cqssc");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_ssc")->where("uid = $uid and lotteryclass=13")->order("id desc")->limit(4)->select();
		$gw = M("jihua_ssc_gw")->order("id desc")->limit(10)->select();
		$sw = M("jihua_ssc_sw")->order("id desc")->limit(10)->select();
		$bw = M("jihua_ssc_bw")->order("id desc")->limit(10)->select();
		$qw = M("jihua_ssc_qw")->order("id desc")->limit(10)->select();
		$ww = M("jihua_ssc_ww")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($gw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$gw[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$gw[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$gw[$k]['sta'] = $zz1;
		}
		foreach($sw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$sw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$sw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$sw[$k]['sta'] = $zz1;
		}
		foreach($bw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$bw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$bw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$bw[$k]['sta'] = $zz1;
		}
		foreach($qw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$qw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$qw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$qw[$k]['sta'] = $zz1;
		}
		foreach($ww as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$ww[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$ww[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$ww[$k]['sta'] = $zz1;
		}


		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("gw",$gw);
		$this->assign("sw",$sw);
		$this->assign("bw",$bw);
		$this->assign("qw",$qw);
		$this->assign("ww",$ww);
		$this->display();
	}
	public function xjssc(){
		$arr = $this->get_data("xjssc");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_ssc")->where("uid = $uid and lotteryclass=17")->order("id desc")->limit(4)->select();
		$gw = M("jihua_xjssc_gw")->order("id desc")->limit(10)->select();
		$sw = M("jihua_xjssc_sw")->order("id desc")->limit(10)->select();
		$bw = M("jihua_xjssc_bw")->order("id desc")->limit(10)->select();
		$qw = M("jihua_xjssc_qw")->order("id desc")->limit(10)->select();
		$ww = M("jihua_xjssc_ww")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($gw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$gw[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$gw[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$gw[$k]['sta'] = $zz1;
		}
		foreach($sw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$sw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$sw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$sw[$k]['sta'] = $zz1;
		}
		foreach($bw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$bw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$bw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$bw[$k]['sta'] = $zz1;
		}
		foreach($qw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$qw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$qw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$qw[$k]['sta'] = $zz1;
		}
		foreach($ww as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$ww[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$ww[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$ww[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("gw",$gw);
		$this->assign("sw",$sw);
		$this->assign("bw",$bw);
		$this->assign("qw",$qw);
		$this->assign("ww",$ww);
		$this->display();
	}
	public function tjssc(){
		$arr = $this->get_data("tjssc");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_ssc")->where("uid = $uid and lotteryclass=18")->order("id desc")->limit(4)->select();
		$gw = M("jihua_tjssc_gw")->order("id desc")->limit(10)->select();
		$sw = M("jihua_tjssc_sw")->order("id desc")->limit(10)->select();
		$bw = M("jihua_tjssc_bw")->order("id desc")->limit(10)->select();
		$qw = M("jihua_tjssc_qw")->order("id desc")->limit(10)->select();
		$ww = M("jihua_tjssc_ww")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($gw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$gw[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$gw[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$gw[$k]['sta'] = $zz1;
		}
		foreach($sw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$sw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$sw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$sw[$k]['sta'] = $zz1;
		}
		foreach($bw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$bw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$bw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$bw[$k]['sta'] = $zz1;
		}
		foreach($qw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$qw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$qw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$qw[$k]['sta'] = $zz1;
		}
		foreach($ww as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$ww[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$ww[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$ww[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("gw",$gw);
		$this->assign("sw",$sw);
		$this->assign("bw",$bw);
		$this->assign("qw",$qw);
		$this->assign("ww",$ww);
		$this->display();
	}
	public function ajssc(){
		$arr = $this->get_data("ffc2");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_ssc")->where("uid = $uid and lotteryclass=19")->order("id desc")->limit(4)->select();
		$gw = M("jihua_ajssc_gw")->order("id desc")->limit(10)->select();
		$sw = M("jihua_ajssc_sw")->order("id desc")->limit(10)->select();
		$bw = M("jihua_ajssc_bw")->order("id desc")->limit(10)->select();
		$qw = M("jihua_ajssc_qw")->order("id desc")->limit(10)->select();
		$ww = M("jihua_ajssc_ww")->order("id desc")->limit(10)->select();
		$tt = array();
		$tt1 = array();
		$tt2 = array();
		foreach($gw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$gw[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$gw[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$gw[$k]['sta'] = $zz1;
		}
		foreach($sw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$sw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$sw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$sw[$k]['sta'] = $zz1;
		}
		foreach($bw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$bw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$bw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$bw[$k]['sta'] = $zz1;
		}
		foreach($qw as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$qw[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$qw[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$qw[$k]['sta'] = $zz1;
		}
		foreach($ww as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt1[] = substr($va,-3);
			}
			if(count($tt1)>1){
				$ww[$k]['iss'] = $tt1[0]."-".$tt1[1];
			}else{
				$ww[$k]['iss'] = $tt1[0];
			}
			$tt1 = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$ww[$k]['sta'] = $zz1;
		}

		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end
//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("gw",$gw);
		$this->assign("sw",$sw);
		$this->assign("bw",$bw);
		$this->assign("qw",$qw);
		$this->assign("ww",$ww);
		$this->display();
	}




    //pk10追号计划
    public function zhui_pk10(){
        $this->display();
    }
	public function pk10(){
		$arr = $this->get_data("bjpk10");
		$uid = $_SESSION['user_id'];
		$res = M("lottery_pk10")->where("uid = $uid and lotteryclass=21")->order("id desc")->limit(4)->select();
		$he = M("jihua_pk10")->order("id desc")->limit(10)->select();
		$tt = array();
		foreach($he as $k=>$v){
			$cc = explode("-",trim($v['issue']));
			foreach($cc as $ka=>$va){
				$tt[] = substr($va,-3);
			}
			if(count($tt)>1){
				$he[$k]['iss'] = $tt[0]."-".$tt[1];
			}else{
				$he[$k]['iss'] = $tt[0];
			}
			$tt = array();
			$zz = explode(",",$v['status']);
			$zz1 = array_filter($zz);
			$he[$k]['sta'] = $zz1;
		}
		//中奖信息 begin
		$r1 = M("lottery_add la")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on la.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on la.lotteryclass=c.id")
			->where("la.zong_money>0")
			->field("la.uid,la.lotteryclass,la.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,la.ctime,c.name")
			->select();
		$r2 = M("lottery_ssc ls")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on ls.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on ls.lotteryclass=c.id")
			->where("ls.zong_money>0")
			->field("ls.uid,ls.lotteryclass,ls.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,ls.ctime,c.name")
			->select();
		$r3 = M("lottery_pk10 lp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lp.lotteryclass=c.id")
			->where("lp.zong_money>0")
			->field("lp.uid,lp.lotteryclass,lp.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lp.ctime,c.name")
			->select();
		$r4 = M("lottery_kl8 lk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lk.lotteryclass=c.id")
			->where("lk.zong_money>0")
			->field("lk.uid,lk.lotteryclass,lk.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lk.ctime,c.name")
			->select();
		$r5 = M("lottery_11x5 l1")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on l1.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on l1.lotteryclass=c.id")
			->where("l1.zong_money>0")
			->field("l1.uid,l1.lotteryclass,l1.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,l1.ctime,c.name")
			->select();
		$r6 = M("lottery_fc3d lf")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on lf.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on lf.lotteryclass=c.id")
			->where("lf.zong_money>0")
			->field("lf.uid,lf.lotteryclass,lf.zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,lf.ctime,c.name")
			->select();
		$r7 = M("zhui_kl8 zk")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zk.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zk.lotteryclass=c.id")
			->where("zk.zo_money>0")
			->field("zk.uid,zk.lotteryclass,zk.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zk.ctime,c.name")
			->select();
		$r8 = M("zhui_pk10 zp")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zp.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zp.lotteryclass=c.id")
			->where("zp.zo_money>0")
			->field("zp.uid,zp.lotteryclass,zp.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zp.ctime,c.name")
			->select();
		$r9 = M("zhui_ssc zs")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zs.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zs.lotteryclass=c.id")
			->where("zs.zo_money>0")
			->field("zs.uid,zs.lotteryclass,zs.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zs.ctime,c.name")
			->select();
		$r10 = M("zhui_x5 zx")
			->join(" join ".C("DB_PREFIX")."accountsinfo a on zx.uid=a.userid")
			->join(" join ".C("DB_PREFIX")."lottery_class c on zx.lotteryclass=c.id")
			->where("zx.zo_money>0")
			->field("zx.uid,zx.lotteryclass,zx.zo_money as zong_money,a.sex,a.accounts,a.score,a.avatar,a.nickname,zx.ctime,c.name")
			->select();
		$r = array_merge($r1,$r2,$r3,$r4,$r5,$r6,$r7,$r8,$r9,$r10);
		$tu1 = array();
		foreach($r as $kp=>$vp){
			$tu1[] = $vp['uid'];
		}
		$tuss = implode(",",$tu1);
		if($tuss){
			$where1 = "uid in($tuss)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($r as $ka1=>$va){
			$total = 0;//总
			foreach ($sum11 as $key1 => $value1) {
				if($va['uid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['uid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['uid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['uid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['uid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['uid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['uid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['uid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['uid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['uid']==$value101['uid']){
					$total+=$value101['zo_money'];
				}
			}
			$r[$ka1]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$r[$ka1]['touxie'] = $touxie;
			$r[$ka1]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$r[$ka1]['sex'] = $sex;
		}
		$age = array();
		foreach ($r as $users) {
			$age[] = $users['ctime'];
		}
		array_multisort($age, SORT_DESC, $r);

		$data1 = M("notice")->select();
		$this->assign("data1",$data1);
		$this->assign("r",$r);
		//中奖信息 end

		//		昨日奖金榜 begin
		$data = M('Accountsinfo')
			->field("userid,nickname,avatar,accounts,sex,score")
			->select();
		$tu = array();
		foreach($data as $kk=>$vv){
			$tu[] = $vv['userid'];
		}
		$tus = implode(",",$tu);
		$start = strtotime(date("Y-m-d",strtotime("-1 day"))." 00:00:00");
		$end = strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");
		if($tus){
			$where = "uid in($tus) and ctime >= $start and ctime <= $end";
			$sum1 = M("lottery_add")->where($where)->select();
			$sum2 = M("lottery_ssc")->where($where)->select();
			$sum3 = M("lottery_pk10")->where($where)->select();
			$sum4 = M("lottery_kl8")->where($where)->select();
			$sum5 = M("lottery_11x5")->where($where)->select();
			$sum6 = M("lottery_fc3d")->where($where)->select();
			$sum7 = M("zhui_kl8")->where($where)->select();
			$sum8 = M("zhui_pk10")->where($where)->select();
			$sum9 = M("zhui_ssc")->where($where)->select();
			$sum10 = M("zhui_x5")->where($where)->select();
			$where1 = "uid in($tus)";
			$sum11 = M("lottery_add")->where($where1)->select();
			$sum21 = M("lottery_ssc")->where($where1)->select();
			$sum31 = M("lottery_pk10")->where($where1)->select();
			$sum41 = M("lottery_kl8")->where($where1)->select();
			$sum51 = M("lottery_11x5")->where($where1)->select();
			$sum61 = M("lottery_fc3d")->where($where1)->select();
			$sum71 = M("zhui_kl8")->where($where1)->select();
			$sum81 = M("zhui_pk10")->where($where1)->select();
			$sum91 = M("zhui_ssc")->where($where1)->select();
			$sum101 = M("zhui_x5")->where($where1)->select();
		}
		foreach($data as $ka=>$va){
			$total = 0;//总
			$zuo = 0;//昨日
			foreach ($sum1 as $key => $value) {
				if($va['userid']==$value['uid']){
					$zuo+=$value['zong_money'];
				}
			}
			foreach ($sum2 as $key2 => $value2) {
				if($va['userid']==$value2['uid']){
					$zuo+=$value2['zong_money'];
				}
			}
			foreach ($sum3 as $key3 => $value3) {
				if($va['userid']==$value3['uid']){
					$zuo+=$value3['zong_money'];
				}
			}
			foreach ($sum4 as $key4 => $value4) {
				if($va['userid']==$value4['uid']){
					$zuo+=$value4['zong_money'];
				}
			}
			foreach ($sum5 as $key5 => $value5) {
				if($va['userid']==$value5['uid']){
					$zuo+=$value5['zong_money'];
				}
			}
			foreach ($sum6 as $key6 => $value6) {
				if($va['userid']==$value6['uid']){
					$zuo+=$value6['zong_money'];
				}
			}
			foreach ($sum7 as $key7 => $value7) {
				if($va['userid']==$value7['uid']){
					$zuo+=$value7['zo_money'];
				}
			}
			foreach ($sum8 as $key8 => $value8) {
				if($va['userid']==$value8['uid']){
					$zuo+=$value8['zo_money'];
				}
			}
			foreach ($sum9 as $key9 => $value9) {
				if($va['userid']==$value9['uid']){
					$zuo+=$value9['zo_money'];
				}
			}
			foreach ($sum10 as $key10 => $value10) {
				if($va['userid']==$value10['uid']){
					$zuo+=$value10['zong_money'];
				}
			}
			foreach ($sum11 as $key1 => $value1) {
				if($va['userid']==$value1['uid']){
					$total+=$value1['zong_money'];
				}
			}
			foreach ($sum21 as $key21 => $value21) {
				if($va['userid']==$value21['uid']){
					$total+=$value21['zong_money'];
				}
			}
			foreach ($sum31 as $key31 => $value31) {
				if($va['userid']==$value31['uid']){
					$total+=$value31['zong_money'];
				}
			}
			foreach ($sum41 as $key41 => $value41) {
				if($va['userid']==$value41['uid']){
					$total+=$value41['zong_money'];
				}
			}
			foreach ($sum51 as $key51 => $value51) {
				if($va['userid']==$value51['uid']){
					$total+=$value51['zong_money'];
				}
			}
			foreach ($sum61 as $key61 => $value61) {
				if($va['userid']==$value61['uid']){
					$total+=$value61['zong_money'];
				}
			}
			foreach ($sum71 as $key71 => $value71) {
				if($va['userid']==$value71['uid']){
					$total+=$value71['zo_money'];
				}
			}
			foreach ($sum81 as $key81 => $value81) {
				if($va['userid']==$value81['uid']){
					$total+=$value81['zo_money'];
				}
			}
			foreach ($sum91 as $key91 => $value91) {
				if($va['userid']==$value91['uid']){
					$total+=$value91['zo_money'];
				}
			}
			foreach ($sum101 as $key101 => $value101) {
				if($va['userid']==$value101['uid']){
					$total+=$value101['zong_money'];
				}
			}
			$data[$ka]['zuo_money'] = $zuo;
			$data[$ka]['total'] = $total;
			if($va['score'] < '10'){
				$touxie = 'VIP1';
				$zhiw = "农民";
			}elseif('10' <= $va['score'] && $va['score'] < '200'){
				$touxie = 'VIP2';
				$zhiw = "地主";
			}elseif('200' <= $va['score'] && $va['score'] < '1000'){
				$touxie = 'VIP3';
				$zhiw = "知县";
			}elseif('1000' <= $va['score'] && $va['score'] < '10000'){
				$touxie = 'VIP4';
				$zhiw = "通判";
			}elseif('10000' <= $va['score'] && $va['score'] < '50000'){
				$touxie = 'VIP5';
				$zhiw = "知府";
			}elseif('50000' <= $va['score'] && $va['score'] < '250000'){
				$touxie = 'VIP6';
				$zhiw = "总督";
			}elseif('250000' <= $va['score'] && $va['score'] < '1000000'){
				$touxie = 'VIP7';
				$zhiw = "巡抚";
			}elseif('1000000' <= $va['score'] && $va['score'] < '5000000'){
				$touxie = 'VIP8';
				$zhiw = "丞相";
			}elseif('5000000' <= $va['score']){
				$touxie = 'VIP9';
				$zhiw = "帝王";
			}
			$data[$ka]['touxie'] = $touxie;
			$data[$ka]['zhiw'] = $zhiw;
			if($va['sex']=='1'){
				$sex = "男";
			}if($va['sex']=='2'){
				$sex = "女";
			}if($va['sex']=='3'){
				$sex = "保密";
			}
			$data[$ka]['sex'] = $sex;
		}
		$ages = array();
		foreach ($data as $user) {
			$ages[] = $user['zuo_money'];
		}
		array_multisort($ages, SORT_DESC, $data);
		$da = array_slice($data,0,10);
		$this->assign("da",$da);
//昨日奖金榜 end
		$this->assign("arr",$arr);
		$this->assign("res",$res);
		$this->assign("he",$he);
		$this->display();
	}
	//获取 接口数据
	static function get_data($a){
		$url = "http://a.apiplus.net/newly.do?token=7684e585c2f14db0&code=".$a."&format=json&rows=10";
		$ch = curl_init();
		curl_setopt ($ch, CURLOPT_URL,$url);
		curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
		$file_contents = curl_exec($ch);
		curl_close($ch);
		$data = json_decode($file_contents,true);
		$arr = $data["data"];
		foreach($arr as $k=>$v){
			$arr[$k]['ocode'] = explode(",",$v['opencode']);
		}

		foreach($arr as $k=>$v){
			$m = 0;
			foreach($v['ocode'] as $kc=>$vc){
				$m+=$vc;
			}
			$arr[$k]['total'] = $m;
			if($m>=3 && $m<=10){
				$arr[$k]['size'] = '1';//小
			}if($m>=11 && $m<=18){
				$arr[$k]['size'] = '2';//大
			}
			if($m%2!=0){
				$arr[$k]['attr'] = '1';//单
			}else{
				$arr[$k]['attr'] = '2';//双
			}
			//	unset($arr[$k]['ocode']);
		}
		return $arr;
	}
}